<template>
    <uni-popup ref="alertDialogRef" type="dialog">
        <uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="提示" content="是否确认切换角色!" @confirm="confirm"
                          @close="close"></uni-popup-dialog>
    </uni-popup>
</template>
<script setup>
const alertDialogRef=ref()
const roleInfo=qly.storage.storageRef('roleInfo')

const open=()=>{
    alertDialogRef.value.open()
}
const confirm=()=>{
    roleInfo.value=roleInfo.value==='guide'?'driver':'guide'
    console.log('roleInfo',roleInfo.value)
    
    close()
}
const close=()=>{
    alertDialogRef.value.close()
}
defineExpose({
    open,
    close
})
</script>
<style scoped lang="scss">

</style>
